﻿@{
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
    ViewBag.Title = "网非e学院--首页";
    var courseList = ViewBag.CourseList as List<XZL.Web.Entity.Course>;
    var flashList = ViewBag.FlashList as List<XZL.Web.Da.Proc_BannerInfo_SelectListResult>;
}
<div>
    <!--顶部flash新版-->
    <div class="swipe" id="hp_flash" style="visibility: visible;">
        <div class="swipe-wrap">
            @foreach (var item in flashList)
            {
                <div id="@item.BannerName" class="hp_flashItem">
                    <img src="@item.BannerImg" class="hp_flashImg" />
                    <span style="display:none" class="hp_flashLink">@item.BannerLink</span>
                </div>
            }
        </div>
        <div id="hp_flashTitle" class="hp_flashTitle"></div>
        <div id="hp_flashTitleText" class="hp_flashTitleText">@flashList[0].BannerName</div>
    </div>

    <!--课程类型-->
    <div class="hp_TypeList" id="hp_TypeList">
        <div class="hp_TypeTitle">
            精彩专题
        </div>
        <div style="margin-top:10px">
            <div class="hp_Type" onclick="document.location='../../Course/Index?Type=1'">
                <img class="hp_TypeImg" src="~/Image/logoqing.png" /><br />
                &nbsp;情商育儿
            </div>
            <div class="hp_Type" onclick="document.location = '../../Course/Index?Type=2'">
                <img class="hp_TypeImg" src="~/Image/logoxue.png" /><br />
                &nbsp;学习方法
            </div>
            <div class="hp_Type" onclick="document.location = '../../Course/Index?Type=3'">
                <img class="hp_TypeImg" src="~/Image/logoqu.png" /><br />
                &nbsp;兴趣培养
            </div>
            <div class="hp_Type" onclick="document.location = '../../Course/Index?Type=4'">
                <img class="hp_TypeImg" src="~/Image/logoliu.png" /><br />
                &nbsp;留学攻略
            </div>
        </div>
    </div><br />

    <!--直播 录播-->
    <div class="ci_Title">
        <span onclick="document.location = '../../Home/Index?Type=1'" class="hp_TypeNav  hp_TypeNavSel">直播课</span>&nbsp;|
        <span onclick="document.location = '../../Home/Index?Type=2'" class="hp_TypeNav">录播课</span>
    </div>

    <!--课程列表-->
    <div id="courseConList">
        @foreach (var item in courseList)
        {
            <div class="courseBG" onclick="document.location='../../Course/CourseInfo?CourseID=@item.CourseID&InviteID=@ViewBag.InviteID'">
                <div class="courseItem">
                    <img src="@item.CourseImg" class="courseImg" />
                    <span class="courseText">
                        <span class="courseTitle">
                            @item.CourseName
                        </span><br />
                        <span class="courseStart">
                            开课时间：@item.StartTime.ToString("MM/dd HH:mm")
                        </span><br />
                        <span>
                            @item.TeacherName | @item.TeacherTitle1
                        </span><br />
                        <span>
                            @item.TeacherTitle2
                        </span>
                    </span>
                </div>
            </div>
        }
        <div class="courseMore" onclick="document.location = '../../Course/Index'">发现更多精彩课程</div>
    </div>
</div>

<script src="~/Scripts/swipe.js"></script>
<script type="text/javascript">
    //顶部flash新版
    var widthScreen = document.body.clientWidth;
    var heightScreen = widthScreen * 11 / 18;
    var num = 0;
    $(".hp_flashImg").height(heightScreen);
    $("#hp_flash").height(heightScreen);
    window.mySwipe = new Swipe(document.getElementById('hp_flash'), {
        startSlide: 0,
        speed: 400,
        auto: 2500,
        continuous: true,
        disableScroll: false,
        stopPropagation: false,
        callback: function (index, elem) {
            num = index;
            $("#hp_flashTitleText").html($("#hp_flash .hp_flashItem").eq(num).attr("id"));
        },
        transitionEnd: function (index, elem) { }
    });

    ///点击banner图片
    $("#hp_flash").click(function () {
        var link = $(".hp_flashLink").eq(num).html();
        location.href = link;
    })

    //直播录播 默认选中
    var type = @ViewBag.IsLive
    $(".hp_TypeNav").removeClass("hp_TypeNavSel");
    $(".hp_TypeNav").eq(type - 1).addClass("hp_TypeNavSel");


    //课程列表通过图片计算显示大小
    var courseHight = ($(".courseImg").eq(0).width()) * 4 / 5;
    $(".courseItem").height(courseHight);
    $(".courseImg").height(courseHight);
    $(".courseText").height(courseHight);

    //底部导航选中
    $("#ImgShouYe").attr("src", "../../Image/logoShouyeSel.png");
</script>
